<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<link rel="stylesheet" href="/css/message.css" type="text/css" media="all" />
<script type="text/javascript">
	$(document).ready(function() {
		document.loginForm.j_username.focus();
		
		$("#loginForm").submit(function() {
			var username = $("#j_username").val();
			var password = $("#j_password").val();
			if (username == '' || password == '') {
				alert('Cần điền đủ username và password');
				return false;
			}
		});
	});
</script>
<div id="rightBar">
	<div class="box">
		<h3 class="boxTitle">Đăng nhập</h3>
		<c:if test="${not empty error}">
			<div class="errorblock">
				${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
			</div>
		</c:if>
		<form name='loginForm' id="loginForm" action="j_spring_security_check" method='POST'>
			<table align="center">
				<tr>
					<td>Username</td>
					<td><input type='text' name='j_username' id="j_username" value=''></td>
				</tr>
				<tr>
					<td>Password</td>
					<td><input type='password' name='j_password' id="j_password" /></td>
				</tr>
				<tr>
					<td><input type="checkbox" name="_spring_security_remember_me" id="_spring_security_remember_me" style="float:right" /></td>
					<td>Remember me</td>
				</tr>
				<tr>
					<td></td>
					<td><input name="submit" type="submit" value="Đăng nhập" /></td>
				</tr>
				<tr>
					<td colspan="2"><a href="/forgetPassword.html">Quên mật khẩu</a></td>
				</tr>
			</table>
		</form>
	</div>
	<div style="display: block; height: 300px;"></div>
</div>